package org.example.controller;

//import lombok.extern.slf4j.Slf4j;
//import org.example.domain.bean.RestResponse;
import org.example.service.UserFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
//@Slf4j
public class UserFeignController {

    @Resource
    private UserFeignService userFeignService;

    @RequestMapping("/logout")
    public void logout() {
        userFeignService.logout();
    }


    @RequestMapping("/doc1")
    public void a(HttpServletResponse response){
        try {
            response.sendRedirect("http://localhost:8001/doc.html#/home");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @RequestMapping("/doc2")
    public void b(HttpServletResponse response){
        try {
            response.sendRedirect("http://localhost:8002/doc.html#/home");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
